package com.rykj.qxj.server.services;

import com.github.pagehelper.PageInfo;
import com.rykj.qxj.server.model.entity.MetadataBasic;
import com.rykj.qxj.server.model.entity.MetadataElement;
import com.rykj.qxj.server.model.param.AuditParams;
import com.rykj.qxj.server.model.param.DeleteFieldParams;
import com.rykj.qxj.server.model.param.MetadataParams;

import java.sql.Connection;
import java.util.List;
import java.util.Map;


public interface IMetadataManageService {


    public String saveMetadataBasic(MetadataParams  metadataParams) throws Exception;

    public String updateMetadataBasic(MetadataParams metadataParams) throws Exception;

    public String deleteMetadataBasicById(Integer metadataBasicId) throws Exception ;

    public String saveMetadataElement(MetadataParams  metadataParams ) throws Exception;

    public String updateMetadataElement(MetadataParams metadataParams) throws Exception;

    public PageInfo getMetadataBasicList(Integer pageNum, Integer pageSize, String tableName,String tableNotes, String classification,
                                         String directory,String belongDatabase,String auditStatus);

    public PageInfo getMetadataElementList(Integer pageNum, Integer pageSize, String tableName,Integer tableId);

    public MetadataBasic getMetadataBasicId(Integer metadataBasicId);

    public String deleteMetadataElementById(DeleteFieldParams deleteFieldParams) throws Exception ;

    public   List<MetadataElement> getElement(MetadataBasic metadataBasic) throws  Exception;

    public Integer checkTableName(String tableName, String belongDatabase) ;

    /**
     * 创建数据库连接
     * @param metadataParams
     */
    public Connection createDatabaseConn(MetadataParams metadataParams) throws  Exception;

    /**
     * 审核通过 新增字段生效操作
     * @param auditParams
     */
    public String addAuditFields(AuditParams auditParams) throws Exception ;

    /**
     * 审核通过 修改字段生效操作
     * @param auditParams
     * @return
     */
    public String modifyAuditFields(AuditParams auditParams) throws Exception ;

    /**
     * 审核通过 删除字段生效操作
     * @param auditParams
     */
    public String dropAuditFields(AuditParams auditParams) throws Exception ;

    public String createdAuditTable(AuditParams auditParams) throws Exception ;
   //删除表
    public String dropAuditTable(AuditParams auditParams) throws Exception;
    
    List<Map<String,Object>> selectDataCalogau();


    PageInfo getTableClassList(Integer pageNum, Integer pageSize, String directory,String notes,String grade);
}
